package com.qf.shopuser.controller;

import com.baomidou.mybatisplus.plugins.Page;
import com.qf.entity.User;
import com.qf.resp.ResultEntity;
import com.qf.shopuser.service.UserService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/userController")
public class UserController {



    @Autowired
    private UserService userService;

    @RequestMapping("/addUser")
    public ResultEntity addUser(@RequestBody User user){
        return ResultEntity.success(userService.insert(user));
    }


    @RequestMapping("/getUserPage")
    public Page<User> getUserPage(@RequestBody Page<User> page){
        return userService.selectPage(page);
    }


}
